/*! \file CommandLine.h
 *	\brief <write description for CommandLine.h>
 *
 *	created:	2010/12/17
 *	created:	17:12:2010   13:58
 *	filename: 	c:\src\tactics-engine\libs\utils\CommandLine.h
 *	file path:	c:\src\tactics-engine\libs\utils
 *	file base:	CommandLine
 *	file ext:	h
 *	author:		Vitalii Trubchaninov
 *				vitalii.trubchaninov@ubisoft.com
 */

#ifndef _utils_COMMANDLINE_H_
#define _utils_COMMANDLINE_H_

#pragma once

#include <core/Map.h>
#include <core/String.h>

namespace tt{
namespace utils{

class CommandLine
{
	typedef String value_type;
public:
	CommandLine();
	~CommandLine();

	void Init(const Char* commandLine);
	void InitFromStd();
	void InitFromStdWithAdditionalParams(const Char*);

	bool IsPresent(const Char* key);
	void GetString(const Char* key, value_type&);
	void GetUInt(const Char* key, UInt& value);

private:
	String getToken(const Char**);
	bool isKeyName(const value_type&);

private:
	typedef core::Map<value_type, value_type>::Type Parameters;
	Parameters m_parameters;
};

} //namespace utils
} //namespace tt

#endif //_utils_COMMANDLINE_H_